/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AboutDialog.java
 *
 * Created on 29-Mar-2009, 16:52:42
 */

package edu.napier.soc.xfdm.uci;

import edu.napier.soc.xfdm.launcher.ApplicationInfo;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @author Thomas
 */
public class AboutDialog extends javax.swing.JDialog {

	/**
	 * Creates new form AboutDialog
	 *
	 * @param parent
	 * @param modal
	 */
	public AboutDialog(java.awt.Frame parent, boolean modal) {
		super(parent, modal);
		initComponents();
		setLocationRelativeTo(parent);
	}

	/**
	 * This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
	// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
	private void initComponents() {
		GridBagConstraints gridBagConstraints;

		splashIcon = new JLabel();
		closeButton = new JButton();
		informationPanel = new JPanel();
		versionaLabel = new JLabel();
		versionbLabel = new JLabel();
		developeraLabel = new JLabel();
		developerbLabel = new JLabel();
		emailaLabel = new JLabel();
		emailbLabel = new JLabel();
		jLabel1 = new JLabel();
		jLabel2 = new JLabel();

		setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		setTitle("About");
		setResizable(false);
		getContentPane().setLayout(new GridBagLayout());

		splashIcon.setHorizontalAlignment(SwingConstants.CENTER);
		splashIcon.setIcon(new ImageIcon(getClass().getResource(
				"/edu/napier/soc/xfdm/resources/logo.png"))); // NOI18N
		gridBagConstraints = new GridBagConstraints();
		gridBagConstraints.gridx = 0;
		gridBagConstraints.gridy = 0;
		gridBagConstraints.fill = GridBagConstraints.BOTH;
		getContentPane().add(splashIcon, gridBagConstraints);

		closeButton.setText("Close");
		closeButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				closeButtonActionPerformed(evt);
			}
		});
		gridBagConstraints = new GridBagConstraints();
		gridBagConstraints.gridx = 0;
		gridBagConstraints.gridy = 2;
		gridBagConstraints.insets = new Insets(5, 0, 5, 0);
		getContentPane().add(closeButton, gridBagConstraints);

		informationPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
		informationPanel.setLayout(new GridLayout(4, 2, 5, 3));

		versionaLabel.setHorizontalAlignment(SwingConstants.RIGHT);
		versionaLabel.setText("Version:");
		informationPanel.add(versionaLabel);

		versionbLabel.setText(ApplicationInfo.VERSION);
		informationPanel.add(versionbLabel);

		developeraLabel.setHorizontalAlignment(SwingConstants.RIGHT);
		developeraLabel.setText("Developer:");
		informationPanel.add(developeraLabel);

		developerbLabel.setText(ApplicationInfo.DEVELOPER);
		informationPanel.add(developerbLabel);

		emailaLabel.setHorizontalAlignment(SwingConstants.RIGHT);
		emailaLabel.setText("Email:");
		informationPanel.add(emailaLabel);

		emailbLabel.setText(ApplicationInfo.EMAIL);
		informationPanel.add(emailbLabel);

		jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);
		jLabel1.setText("Website:");
		informationPanel.add(jLabel1);

		jLabel2.setText("<html><a href=\"ApplicationInfo.WEBSITE\">" +
				ApplicationInfo.WEBSITE + "</a></html>");
		informationPanel.add(jLabel2);

		gridBagConstraints = new GridBagConstraints();
		gridBagConstraints.gridx = 0;
		gridBagConstraints.gridy = 1;
		gridBagConstraints.fill = GridBagConstraints.BOTH;
		gridBagConstraints.weighty = 1.0;
		getContentPane().add(informationPanel, gridBagConstraints);

		pack();
	}// </editor-fold>//GEN-END:initComponents

	private void closeButtonActionPerformed(
			ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
		dispose();
	}//GEN-LAST:event_closeButtonActionPerformed

	// Variables declaration - do not modify//GEN-BEGIN:variables
	private JButton closeButton;
	private JLabel developeraLabel;
	private JLabel developerbLabel;
	private JLabel emailaLabel;
	private JLabel emailbLabel;
	private JPanel informationPanel;
	private JLabel jLabel1;
	private JLabel jLabel2;
	private JLabel splashIcon;
	private JLabel versionaLabel;
	private JLabel versionbLabel;
	// End of variables declaration//GEN-END:variables

}
